package inv.cal;

import inv.cal.logic.EventsInfo;
import inv.cal.logic.Manager;

import java.awt.Frame;
import java.util.List;
import java.util.Locale;

public class CalendarFactory {
	public static DatePickerDialog createDatePicker(Frame owner, Locale locale, List<EventsInfo> events) {
		java.util.Calendar cal1	= java.util.Calendar.getInstance(locale);
		Manager manager	= new Manager(cal1, locale);
		manager.addAll(events);
		manager.calculateYearsByEvents();
		DatePickerDialog cal	= new DatePickerDialog(owner, manager);
		
		return cal;
	}
}
